home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
program
/
tpwpxeng.zip
/
PUTSHORT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-07-22
|
795b
|
35 lines
program PutShort;
uses PXEngine, WinCrt;
const TableName = 'Table';
var PxErr: Integer;
TblHandle: TableHandle;
RecHandle: RecordHandle;
FldHandle: FieldHandle;
SValue: Integer;
procedure PX(Code : integer);
begin
writeln(PXErrMsg(Code));
end;
begin
PX(PXWinInit('MyApp', pxShared));
SValue := 321;
PX(PXTblOpen(TableName, TblHandle, 0, False));
PX(PXRecBufOpen(TblHandle, RecHandle));
PX(PXFldHandle(TblHandle, 'Short Field', FldHandle));
(* Update record with short value *)
PxErr := PXPutShort(RecHandle, FldHandle, SValue);
if PxErr <> PxSuccess then
Writeln(PxErrMsg(PxErr))
else PX(PXRecUpdate(TblHandle,RecHandle));
PX(PXRecBufClose(RecHandle));
PX(PXTblClose(TblHandle));
PX(PXExit);
end.